/*
 *  Copyright (C) 2011 glauco
 * 
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 * 
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 * 
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package org.balisunrise.swing.commons;

import javax.swing.JPanel;
import org.balisunrise.common.VisualEntityType;
import org.balisunrise.common.abstracts.AbstractLayoutable;

/**
 *
 * @author glauco
 */
public class Layoutable extends AbstractLayoutable
        implements org.balisunrise.common.Layoutable<JPanel>{

    private static final String PROP_VISUAL_REPRESENTATION = "visualRepresentation";
    private static final String PROP_VISUAL_ENTITY_TYPE = "visualEntityType";

    private JPanel visualRepresentation;
    VisualEntityType visualEntityType;

    @Override
    public VisualEntityType getVisualEntityType() {
        return visualEntityType;
    }

    @Override
    public JPanel getVisualRepresentation() {
        return visualRepresentation;
    }

    public void setVisualEntityType(VisualEntityType visualEntityType) {
        VisualEntityType old = this.visualEntityType;
        this.visualEntityType = visualEntityType;
        changeSupport.firePropertyChange(PROP_VISUAL_ENTITY_TYPE,
                old, visualEntityType);
    }

    public void setVisualRepresentation(JPanel visualRepresentation) {
        JPanel old = this.visualRepresentation;
        this.visualRepresentation = visualRepresentation;
        changeSupport.firePropertyChange(PROP_VISUAL_REPRESENTATION,
                old, visualRepresentation);
    }

}
